# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-hypothesmith
pkgver=0.3.0
pkgrel=1
pkgdesc="Hypothesis strategies for generating Python programs, something like CSmith"
url="https://github.com/Zac-HD/hypothesmith"
license=('MPL')
arch=('any')
depends=('python-hypothesis' 'python-lark-parser' 'python-libcst')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-black' 'python-parso' 'python-pytest')
source=("https://pypi.io/packages/source/h/hypothesmith/hypothesmith-$pkgver.tar.gz")
sha512sums=('9d65ac7ca4c1e63cbe8d26335d10becc404cb9a0eb96bc6c924b347ea32fb5ed999a44a0f48341b8fc7438a50a51fbb9874dfae70746a09fe469d38af7709211')

prepare() {
  cd hypothesmith-$pkgver
  sed -e '/--cov/d' -i tox.ini
}

build() {
  cd hypothesmith-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd hypothesmith-$pkgver
  PYTHONPATH="$PWD/build/lib" pytest -v
}

package() {
  cd hypothesmith-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}
